﻿#include "dialog.h"
#include "ui_dialog.h"

Dialog::Dialog(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::Dialog)
{
    ui->setupUi(this);

    //点击取消关闭窗口
    connect(ui->btn_cencel,&QPushButton::clicked,this,&QDialog::close);

    //点击保存赋直
    connect(ui->btn_save,&QPushButton::clicked,this,&Dialog::getinfo);
}

/************************************
 * function        getinfo
 * destription     保存信息到对象成员
 * input           0
 * return          void
************************************/
void Dialog::getinfo()
{
    nun = ui->let_num->text().toInt();
    name = ui->let_name->text();
    sex = ui->let_sex->text();
    age = ui->let_age->text().toInt();
    this->close();
}


Dialog::~Dialog()
{
    delete ui;
}
